﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Brainee.NeuralNetwork
{
  public class HeavisideFunction : IActivationFunction
  {
    public double Invoke (double d)
    {
      return d < 0.0 ? 0.0 : 1.0;
    }

    public bool Differentiable { get { return false; } }

    public double Derivative (double d)
    {
      throw new NotDifferentiableException ("HeavisideFunction");
    }
  }
}
